import { createRouter, createWebHistory } from 'vue-router'
import Home from '../views/home/index.vue'
import TabBar from '../components/TabBar.vue'
const routes = [
  {
    path: '/',
    name: 'home',
    components:{
      default:Home,
      footer:TabBar
    } 
  },
  {
    path: '/cart',
    name: 'cart',
    
    components:{
      default:() => import( '../views/cart/index.vue'),
        footer:TabBar
    } 
  },
  {
    path: '/user',
    name: 'user',
    
    components:{
      default:() => import( '../views/user/index.vue'),
        footer:TabBar
    } 
  },

   {
    path: '/detail/:id',
    name: 'detail',
    
    component: () => import( '../views/detail/index.vue'),
    
    
  },
   {
    path: '/order',
    name: 'order',
    
    component: () => import( '../views/order/index.vue'),
    
    
  },
   {
    path: '/success',
    name: 'success',
    
    component: () => import( '../views/success/index.vue'),
    
    
  },

   {
    path: '/order/detail/:id',
    name: 'orderDetail',
    
    component: () => import( '../views/order/detail.vue'),
    
    
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
